package finelProject;

public class MyAppConstants {
	//derby constants
		public final String DB_NAME = "UsersDB";
		public final static String DB_DATASOURCE = "java:comp/env/jdbc/UserDatasource";
		public final String PROTOCOL = "jdbc:derby:"; 
		
		
		public final static String FOLLOW = "follow";
		public final static String INSERT = "insert";
		public final static String SEPARATOR = "-";
		
		//sql statements
		public final static String CREATE_USERS_TABLE = "CREATE TABLE USERS(UserName varchar(10),"
				+ "Password varchar(8),"
				+ "NickName varchar(20),"
				+ "ShortDescription varchar(50),"
				+ "SetPhotoURL varchar(100)"
				+ "PRIMARY KEY (UserName))";
		public final static String CREATE_MESSAGES_TABLE = "CREATE TABLE MESSAGES(MessageId varchar(10),"
				+ "Author varchar(20),"
				+ "RepublishNumber INTEGER,"
				+ "TimeOfPublish TIMESTAMP,"
				+ "Content varchar(140)"
				+ "PRIMARY KEY (MessageId))";
		public final static String CREATE_FOLLOW_TABLE = "CREATE TABLE FOLLOW(Follower varchar(20),"
				+ "Followe varchar(20)"
				+ "PRIMARY KEY (Follower,Followe))";
		public final static String SUM_NUMBER_OF_FOLLOWERS = "SELECT COUNT(*),"
				+ "FROM(SELECT Followe"
					 + "From FOLLOW,"
					 + "WHERE Followe = ?,"
					 + "GROUP BY Followe)";
		public final static String INSERT_INTO_FOLLOW = "INSERT INTO FOLLOW(Follower,Followe)"
				+ "VALUES(?,?)";
		public final static String INSERT_INTO_USERS = "INSERT INTO USERS(UserName,"
				+ "Password,"
				+ "NickName,"
				+ "ShortDescription,"
				+ "SetPhotoURL)"
				+ "VALUES(?,?,?,?,?)";
		

}
